+Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
+
+ * gdk/gdk.h:
+ * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
+ the current GdkWindow the pointer is on if there is any.
+
+ * gtk/gtktable.c (gtk_table_init): preallocate a table with one row
+ and one column, so we don't construction logic at all. changed a few
+ (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
+ unsigned int wraps.
+
+ * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
+ portion, added an additional check for parent != widget.
+
+ * more GtkType and macro fixups.
+
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
+
+ * gdk/gdk.h:
+ * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
+ the current GdkWindow the pointer is on if there is any.
+
+ * gtk/gtktable.c (gtk_table_init): preallocate a table with one row
+ and one column, so we don't construction logic at all. changed a few
+ (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
+ unsigned int wraps.
+
+ * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
+ portion, added an additional check for parent != widget.
+
+ * more GtkType and macro fixups.
+
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
+
+ * gdk/gdk.h:
+ * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
+ the current GdkWindow the pointer is on if there is any.
+
+ * gtk/gtktable.c (gtk_table_init): preallocate a table with one row
+ and one column, so we don't construction logic at all. changed a few
+ (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
+ unsigned int wraps.
+
+ * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
+ portion, added an additional check for parent != widget.
+
+ * more GtkType and macro fixups.
+
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
+
+ * gdk/gdk.h:
+ * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
+ the current GdkWindow the pointer is on if there is any.
+
+ * gtk/gtktable.c (gtk_table_init): preallocate a table with one row
+ and one column, so we don't construction logic at all. changed a few
+ (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
+ unsigned int wraps.
+
+ * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
+ portion, added an additional check for parent != widget.
+
+ * more GtkType and macro fixups.
+
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
+
+ * gdk/gdk.h:
+ * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
+ the current GdkWindow the pointer is on if there is any.
+
+ * gtk/gtktable.c (gtk_table_init): preallocate a table with one row
+ and one column, so we don't construction logic at all. changed a few
+ (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
+ unsigned int wraps.
+
+ * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
+ portion, added an additional check for parent != widget.
+
+ * more GtkType and macro fixups.
+
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
+
+ * gdk/gdk.h:
+ * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
+ the current GdkWindow the pointer is on if there is any.
+
+ * gtk/gtktable.c (gtk_table_init): preallocate a table with one row
+ and one column, so we don't construction logic at all. changed a few
+ (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
+ unsigned int wraps.
+
+ * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
+ portion, added an additional check for parent != widget.
+
+ * more GtkType and macro fixups.
+
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+Wed Jun 17 03:47:40 1998 Tim Janik <timj@gtk.org>
+
+ * gdk/gdk.h:
+ * gdk/gdkwindow.c: new function gdk_window_at_pointer() to retrive
+ the current GdkWindow the pointer is on if there is any.
+
+ * gtk/gtktable.c (gtk_table_init): preallocate a table with one row
+ and one column, so we don't construction logic at all. changed a few
+ (x < y - 1) to (x + 1 < y), to avoid failing evaluations due to
+ unsigned int wraps.
+
+ * gtk/gtkwidget.c (gtk_widget_set_parent): removed left over code
+ portion, added an additional check for parent != widget.
+
+ * more GtkType and macro fixups.
+
1998-06-16 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
GdkWindowAttr *attributes,
gint attributes_mask);
-GdkWindow * gdk_window_foreign_new (guint32 anid);
+GdkWindow* gdk_window_foreign_new (guint32 anid);
void gdk_window_destroy (GdkWindow *window);
GdkWindow* gdk_window_ref (GdkWindow *window);
void gdk_window_unref (GdkWindow *window);
+GdkWindow* gdk_window_at_pointer (gint *win_x,
+ gint *win_y);
void gdk_window_show (GdkWindow *window);
void gdk_window_hide (GdkWindow *window);
void gdk_window_withdraw (GdkWindow *window);
/* internal function created for and used by gdk_window_xid_at_coords */
Window
-gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
- GList *excludes, gboolean excl_child)
+gdk_window_xid_at (Window base,
+ gint bx,
+ gint by,
+ gint x,
+ gint y,
+ GList *excludes,
+ gboolean excl_child)
{
GdkWindow *window;
GdkWindowPrivate *private;
Display *disp;
- Window *list=NULL;
- Window child=0,parent_win=0,root_win=0;
-
+ Window *list = NULL;
+ Window child = 0, parent_win = 0, root_win = 0;
int i;
unsigned int ww, wh, wb, wd, num;
- int wx,wy;
+ int wx, wy;
- window=(GdkWindow*)&gdk_root_parent;
- private=(GdkWindowPrivate*)window;
- disp=private->xdisplay;
- if (!XGetGeometry(disp,base,&root_win,&wx,&wy,&ww,&wh,&wb,&wd))
+ window = (GdkWindow*) &gdk_root_parent;
+ private = (GdkWindowPrivate*) window;
+ disp = private->xdisplay;
+ if (!XGetGeometry (disp, base, &root_win, &wx, &wy, &ww, &wh, &wb, &wd))
return 0;
- wx+=bx;wy+=by;
- if (!((x>=wx)&&(y>=wy)&&(x<(int)(wx+ww))&&(y<(int)(wy+wh))))
+ wx += bx;
+ wy += by;
+
+ if (!((x >= wx) &&
+ (y >= wy) &&
+ (x < (int) (wx + ww)) &&
+ (y < (int) (wy + wh))))
return 0;
- if (!XQueryTree(disp,base,&root_win,&parent_win,&list,&num))
+
+ if (!XQueryTree (disp, base, &root_win, &parent_win, &list, &num))
return base;
+
if (list)
{
- for (i=num-1;;i--)
+ for (i = num - 1; ; i--)
{
- if ((!excl_child)||(!g_list_find(excludes,(gpointer *)list[i])))
+ if ((!excl_child) || (!g_list_find (excludes, (gpointer *) list[i])))
{
- if ((child=gdk_window_xid_at(list[i],wx,wy,x,y,excludes,excl_child))!=0)
+ if ((child = gdk_window_xid_at (list[i], wx, wy, x, y, excludes, excl_child)) != 0)
{
- XFree(list);
+ XFree (list);
return child;
}
}
- if (!i) break;
+ if (!i)
+ break;
}
- XFree(list);
+ XFree (list);
}
return base;
}
* those X,Y co-ordinates.
*/
Window
-gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
+gdk_window_xid_at_coords (gint x,
+ gint y,
+ GList *excludes,
+ gboolean excl_child)
{
GdkWindow *window;
GdkWindowPrivate *private;
Display *disp;
- Window *list=NULL;
- Window root,child=0,parent_win=0,root_win=0;
+ Window *list = NULL;
+ Window root, child = 0, parent_win = 0, root_win = 0;
unsigned int num;
int i;
- window=(GdkWindow*)&gdk_root_parent;
- private=(GdkWindowPrivate*)window;
- disp=private->xdisplay;
- root=private->xwindow;
- XGrabServer(disp);
- num=g_list_length(excludes);
- if (!XQueryTree(disp,root,&root_win,&parent_win,&list,&num))
- return root;
+ window = (GdkWindow*) &gdk_root_parent;
+ private = (GdkWindowPrivate*) window;
+ disp = private->xdisplay;
+ root = private->xwindow;
+ num = g_list_length (excludes);
+
+ XGrabServer (disp);
+ if (!XQueryTree (disp, root, &root_win, &parent_win, &list, &num))
+ {
+ XUngrabServer(disp);
+ return root;
+ }
if (list)
{
i = num - 1;
if (xwa.map_state != IsViewable)
continue;
- if (excl_child && g_list_find(excludes,(gpointer *)list[i]))
+ if (excl_child && g_list_find (excludes, (gpointer *) list[i]))
continue;
if ((child = gdk_window_xid_at (list[i], 0, 0, x, y, excludes, excl_child)) == 0)
if (excludes)
{
- if (!g_list_find(excludes,(gpointer *)child))
+ if (!g_list_find (excludes, (gpointer *) child))
{
- XFree(list);
- XUngrabServer(disp);
+ XFree (list);
+ XUngrabServer (disp);
return child;
}
}
else
{
- XFree(list);
- XUngrabServer(disp);
+ XFree (list);
+ XUngrabServer (disp);
return child;
}
} while (--i > 0);
- XFree(list);
+ XFree (list);
}
- XUngrabServer(disp);
+ XUngrabServer (disp);
return root;
}
return return_val;
}
+GdkWindow*
+gdk_window_at_pointer (gint *win_x,
+ gint *win_y)
+{
+ GdkWindowPrivate *private;
+ GdkWindow *window;
+ Window root;
+ Window xwindow;
+ Window xwindow_last = 0;
+ int rootx = -1, rooty = -1;
+ int winx, winy;
+ unsigned int xmask;
+
+ private = &gdk_root_parent;
+
+ xwindow = private->xwindow;
+
+ XGrabServer (private->xdisplay);
+ while (xwindow)
+ {
+ xwindow_last = xwindow;
+ XQueryPointer (private->xdisplay,
+ xwindow,
+ &root, &xwindow,
+ &rootx, &rooty,
+ &winx, &winy,
+ &xmask);
+ }
+ XUngrabServer (private->xdisplay);
+
+ window = gdk_window_lookup (xwindow_last);
+
+ if (win_x)
+ *win_x = window ? winx : -1;
+ if (win_y)
+ *win_y = window ? winy : -1;
+
+ return window;
+}
+
GdkWindow*
gdk_window_get_parent (GdkWindow *window)
{
/* internal function created for and used by gdk_window_xid_at_coords */
Window
-gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y,
- GList *excludes, gboolean excl_child)
+gdk_window_xid_at (Window base,
+ gint bx,
+ gint by,
+ gint x,
+ gint y,
+ GList *excludes,
+ gboolean excl_child)
{
GdkWindow *window;
GdkWindowPrivate *private;
Display *disp;
- Window *list=NULL;
- Window child=0,parent_win=0,root_win=0;
-
+ Window *list = NULL;
+ Window child = 0, parent_win = 0, root_win = 0;
int i;
unsigned int ww, wh, wb, wd, num;
- int wx,wy;
+ int wx, wy;
- window=(GdkWindow*)&gdk_root_parent;
- private=(GdkWindowPrivate*)window;
- disp=private->xdisplay;
- if (!XGetGeometry(disp,base,&root_win,&wx,&wy,&ww,&wh,&wb,&wd))
+ window = (GdkWindow*) &gdk_root_parent;
+ private = (GdkWindowPrivate*) window;
+ disp = private->xdisplay;
+ if (!XGetGeometry (disp, base, &root_win, &wx, &wy, &ww, &wh, &wb, &wd))
return 0;
- wx+=bx;wy+=by;
- if (!((x>=wx)&&(y>=wy)&&(x<(int)(wx+ww))&&(y<(int)(wy+wh))))
+ wx += bx;
+ wy += by;
+
+ if (!((x >= wx) &&
+ (y >= wy) &&
+ (x < (int) (wx + ww)) &&
+ (y < (int) (wy + wh))))
return 0;
- if (!XQueryTree(disp,base,&root_win,&parent_win,&list,&num))
+
+ if (!XQueryTree (disp, base, &root_win, &parent_win, &list, &num))
return base;
+
if (list)
{
- for (i=num-1;;i--)
+ for (i = num - 1; ; i--)
{
- if ((!excl_child)||(!g_list_find(excludes,(gpointer *)list[i])))
+ if ((!excl_child) || (!g_list_find (excludes, (gpointer *) list[i])))
{
- if ((child=gdk_window_xid_at(list[i],wx,wy,x,y,excludes,excl_child))!=0)
+ if ((child = gdk_window_xid_at (list[i], wx, wy, x, y, excludes, excl_child)) != 0)
{
- XFree(list);
+ XFree (list);
return child;
}
}
- if (!i) break;
+ if (!i)
+ break;
}
- XFree(list);
+ XFree (list);
}
return base;
}
* those X,Y co-ordinates.
*/
Window
-gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
+gdk_window_xid_at_coords (gint x,
+ gint y,
+ GList *excludes,
+ gboolean excl_child)
{
GdkWindow *window;
GdkWindowPrivate *private;
Display *disp;
- Window *list=NULL;
- Window root,child=0,parent_win=0,root_win=0;
+ Window *list = NULL;
+ Window root, child = 0, parent_win = 0, root_win = 0;
unsigned int num;
int i;
- window=(GdkWindow*)&gdk_root_parent;
- private=(GdkWindowPrivate*)window;
- disp=private->xdisplay;
- root=private->xwindow;
- XGrabServer(disp);
- num=g_list_length(excludes);
- if (!XQueryTree(disp,root,&root_win,&parent_win,&list,&num))
- return root;
+ window = (GdkWindow*) &gdk_root_parent;
+ private = (GdkWindowPrivate*) window;
+ disp = private->xdisplay;
+ root = private->xwindow;
+ num = g_list_length (excludes);
+
+ XGrabServer (disp);
+ if (!XQueryTree (disp, root, &root_win, &parent_win, &list, &num))
+ {
+ XUngrabServer(disp);
+ return root;
+ }
if (list)
{
i = num - 1;
if (xwa.map_state != IsViewable)
continue;
- if (excl_child && g_list_find(excludes,(gpointer *)list[i]))
+ if (excl_child && g_list_find (excludes, (gpointer *) list[i]))
continue;
if ((child = gdk_window_xid_at (list[i], 0, 0, x, y, excludes, excl_child)) == 0)
if (excludes)
{
- if (!g_list_find(excludes,(gpointer *)child))
+ if (!g_list_find (excludes, (gpointer *) child))
{
- XFree(list);
- XUngrabServer(disp);
+ XFree (list);
+ XUngrabServer (disp);
return child;
}
}
else
{
- XFree(list);
- XUngrabServer(disp);
+ XFree (list);
+ XUngrabServer (disp);
return child;
}
} while (--i > 0);
- XFree(list);
+ XFree (list);
}
- XUngrabServer(disp);
+ XUngrabServer (disp);
return root;
}
return return_val;
}
+GdkWindow*
+gdk_window_at_pointer (gint *win_x,
+ gint *win_y)
+{
+ GdkWindowPrivate *private;
+ GdkWindow *window;
+ Window root;
+ Window xwindow;
+ Window xwindow_last = 0;
+ int rootx = -1, rooty = -1;
+ int winx, winy;
+ unsigned int xmask;
+
+ private = &gdk_root_parent;
+
+ xwindow = private->xwindow;
+
+ XGrabServer (private->xdisplay);
+ while (xwindow)
+ {
+ xwindow_last = xwindow;
+ XQueryPointer (private->xdisplay,
+ xwindow,
+ &root, &xwindow,
+ &rootx, &rooty,
+ &winx, &winy,
+ &xmask);
+ }
+ XUngrabServer (private->xdisplay);
+
+ window = gdk_window_lookup (xwindow_last);
+
+ if (win_x)
+ *win_x = window ? winx : -1;
+ if (win_y)
+ *win_y = window ? winy : -1;
+
+ return window;
+}
+
GdkWindow*
gdk_window_get_parent (GdkWindow *window)
{
static GtkContainerClass *parent_class = NULL;
-guint
+GtkType
gtk_box_get_type (void)
{
- static guint box_type = 0;
+ static GtkType box_type = 0;
if (!box_type)
{
(GtkArgGetFunc) gtk_box_get_arg,
};
- box_type = gtk_type_unique (gtk_container_get_type (), &box_info);
+ box_type = gtk_type_unique (GTK_TYPE_CONTAINER, &box_info);
}
return box_type;
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
- parent_class = gtk_type_class (gtk_container_get_type ());
+ parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
gtk_object_add_arg_type ("GtkBox::spacing", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_SPACING);
gtk_object_add_arg_type ("GtkBox::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_BOX(obj) GTK_CHECK_CAST (obj, gtk_box_get_type (), GtkBox)
-#define GTK_BOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_box_get_type (), GtkBoxClass)
-#define GTK_IS_BOX(obj) GTK_CHECK_TYPE (obj, gtk_box_get_type ())
+#define GTK_TYPE_BOX (gtk_box_get_type ())
+#define GTK_BOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_BOX, GtkBox))
+#define GTK_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX, GtkBoxClass))
+#define GTK_IS_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_BOX))
+#define GTK_IS_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX))
-typedef struct _GtkBox GtkBox;
+typedef struct _GtkBox GtkBox;
typedef struct _GtkBoxClass GtkBoxClass;
typedef struct _GtkBoxChild GtkBoxChild;
struct _GtkBox
{
GtkContainer container;
-
+
GList *children;
gint16 spacing;
guint homogeneous : 1;
};
-guint gtk_box_get_type (void);
-void gtk_box_pack_start (GtkBox *box,
+GtkType gtk_box_get_type (void);
+void gtk_box_pack_start (GtkBox *box,
GtkWidget *child,
gboolean expand,
gboolean fill,
- guint padding);
-void gtk_box_pack_end (GtkBox *box,
+ guint padding);
+void gtk_box_pack_end (GtkBox *box,
GtkWidget *child,
gboolean expand,
gboolean fill,
- guint padding);
-void gtk_box_pack_start_defaults (GtkBox *box,
+ guint padding);
+void gtk_box_pack_start_defaults (GtkBox *box,
GtkWidget *widget);
-void gtk_box_pack_end_defaults (GtkBox *box,
+void gtk_box_pack_end_defaults (GtkBox *box,
GtkWidget *widget);
-void gtk_box_set_homogeneous (GtkBox *box,
+void gtk_box_set_homogeneous (GtkBox *box,
gboolean homogeneous);
-void gtk_box_set_spacing (GtkBox *box,
- gint spacing);
-void gtk_box_reorder_child (GtkBox *box,
+void gtk_box_set_spacing (GtkBox *box,
+ gint spacing);
+void gtk_box_reorder_child (GtkBox *box,
GtkWidget *child,
- gint position);
-void gtk_box_query_child_packing (GtkBox *box,
+ gint position);
+void gtk_box_query_child_packing (GtkBox *box,
GtkWidget *child,
gboolean *expand,
gboolean *fill,
- guint *padding,
+ guint *padding,
GtkPackType *pack_type);
-void gtk_box_set_child_packing (GtkBox *box,
+void gtk_box_set_child_packing (GtkBox *box,
GtkWidget *child,
gboolean expand,
gboolean fill,
- guint padding,
+ guint padding,
GtkPackType pack_type);
GtkAllocation *allocation);
-guint
+GtkType
gtk_hbox_get_type (void)
{
- static guint hbox_type = 0;
+ static GtkType hbox_type = 0;
if (!hbox_type)
{
(GtkArgGetFunc) NULL,
};
- hbox_type = gtk_type_unique (gtk_box_get_type (), &hbox_info);
+ hbox_type = gtk_type_unique (GTK_TYPE_BOX, &hbox_info);
}
return hbox_type;
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_HBOX(obj) GTK_CHECK_CAST (obj, gtk_hbox_get_type (), GtkHBox)
-#define GTK_HBOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_hbox_get_type (), GtkHBoxClass)
-#define GTK_IS_HBOX(obj) GTK_CHECK_TYPE (obj, gtk_hbox_get_type ())
+#define GTK_TYPE_HBOX (gtk_hbox_get_type ())
+#define GTK_HBOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_HBOX, GtkHBox))
+#define GTK_HBOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HBOX, GtkHBoxClass))
+#define GTK_IS_HBOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_HBOX))
+#define GTK_IS_HBOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HBOX))
-typedef struct _GtkHBox GtkHBox;
+typedef struct _GtkHBox GtkHBox;
typedef struct _GtkHBoxClass GtkHBoxClass;
struct _GtkHBox
};
-guint gtk_hbox_get_type (void);
-GtkWidget* gtk_hbox_new (gint homogeneous,
+GtkType gtk_hbox_get_type (void);
+GtkWidget* gtk_hbox_new (gint homogeneous,
gint spacing);
guint arg_id);
-guint
+GtkType
gtk_misc_get_type (void)
{
- static guint misc_type = 0;
+ static GtkType misc_type = 0;
if (!misc_type)
{
(GtkArgGetFunc) gtk_misc_get_arg,
};
- misc_type = gtk_type_unique (gtk_widget_get_type (), &misc_info);
+ misc_type = gtk_type_unique (GTK_TYPE_WIDGET, &misc_info);
}
return misc_type;
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_MISC(obj) GTK_CHECK_CAST (obj, gtk_misc_get_type (), GtkMisc)
-#define GTK_MISC_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_misc_get_type (), GtkMiscClass)
-#define GTK_IS_MISC(obj) GTK_CHECK_TYPE (obj, gtk_misc_get_type ())
+#define GTK_TYPE_MISC (gtk_misc_get_type ())
+#define GTK_MISC(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MISC, GtkMisc))
+#define GTK_MISC_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MISC, GtkMiscClass))
+#define GTK_IS_MISC(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MISC))
+#define GTK_IS_MISC_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MISC))
-typedef struct _GtkMisc GtkMisc;
+typedef struct _GtkMisc GtkMisc;
typedef struct _GtkMiscClass GtkMiscClass;
struct _GtkMisc
{
GtkWidget widget;
-
+
gfloat xalign;
gfloat yalign;
-
+
guint16 xpad;
guint16 ypad;
};
};
-guint gtk_misc_get_type (void);
-void gtk_misc_set_alignment (GtkMisc *misc,
- gfloat xalign,
- gfloat yalign);
-void gtk_misc_set_padding (GtkMisc *misc,
- gint xpad,
- gint ypad);
+GtkType gtk_misc_get_type (void);
+void gtk_misc_set_alignment (GtkMisc *misc,
+ gfloat xalign,
+ gfloat yalign);
+void gtk_misc_set_padding (GtkMisc *misc,
+ gint xpad,
+ gint ypad);
#ifdef __cplusplus
#endif /* __cplusplus */
-#endif /* __GTK_LABEL_H__ */
+#endif /* __GTK_MISC_H__ */
static GtkWidgetClass *parent_class;
-guint
+GtkType
gtk_pixmap_get_type (void)
{
- static guint pixmap_type = 0;
+ static GtkType pixmap_type = 0;
if (!pixmap_type)
{
(GtkArgGetFunc) NULL,
};
- pixmap_type = gtk_type_unique (gtk_misc_get_type (), &pixmap_info);
+ pixmap_type = gtk_type_unique (GTK_TYPE_MISC, &pixmap_info);
}
return pixmap_type;
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_PIXMAP(obj) GTK_CHECK_CAST (obj, gtk_pixmap_get_type (), GtkPixmap)
-#define GTK_PIXMAP_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_pixmap_get_type (), GtkPixmapClass)
-#define GTK_IS_PIXMAP(obj) GTK_CHECK_TYPE (obj, gtk_pixmap_get_type ())
+#define GTK_TYPE_PIXMAP (gtk_pixmap_get_type ())
+#define GTK_PIXMAP(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_PIXMAP, GtkPixmap))
+#define GTK_PIXMAP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PIXMAP, GtkPixmapClass))
+#define GTK_IS_PIXMAP(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_PIXMAP))
+#define GTK_IS_PIXMAP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PIXMAP))
-typedef struct _GtkPixmap GtkPixmap;
-typedef struct _GtkPixmapClass GtkPixmapClass;
+typedef struct _GtkPixmap GtkPixmap;
+typedef struct _GtkPixmapClass GtkPixmapClass;
struct _GtkPixmap
{
GtkMisc misc;
-
+
GdkPixmap *pixmap;
GdkBitmap *mask;
};
};
-guint gtk_pixmap_get_type (void);
-GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap,
+GtkType gtk_pixmap_get_type (void);
+GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap,
GdkBitmap *mask);
-void gtk_pixmap_set (GtkPixmap *pixmap,
+void gtk_pixmap_set (GtkPixmap *pixmap,
GdkPixmap *val,
GdkBitmap *mask);
-void gtk_pixmap_get (GtkPixmap *pixmap,
+void gtk_pixmap_get (GtkPixmap *pixmap,
GdkPixmap **val,
GdkBitmap **mask);
table->column_spacing = 0;
table->row_spacing = 0;
table->homogeneous = FALSE;
+
+ gtk_table_resize (table, 1, 1);
}
GtkWidget*
{
g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table));
- /* g_return_if_fail ((row >= 0) && (row < (table->nrows - 1))); */
- g_return_if_fail (row < table->nrows - 1);
+ g_return_if_fail (row + 1 < table->nrows);
if (table->rows[row].spacing != spacing)
{
{
g_return_if_fail (table != NULL);
g_return_if_fail (GTK_IS_TABLE (table));
- /* g_return_if_fail ((column >= 0) && (column < (table->ncols - 1))); */
- g_return_if_fail (column < table->ncols - 1);
+ g_return_if_fail (column + 1 < table->ncols);
if (table->cols[column].spacing != spacing)
{
g_return_if_fail (GTK_IS_TABLE (table));
table->row_spacing = spacing;
- for (row = 0; row < table->nrows - 1; row++)
+ for (row = 0; row + 1 < table->nrows; row++)
table->rows[row].spacing = spacing;
if (GTK_WIDGET_VISIBLE (table))
g_return_if_fail (GTK_IS_TABLE (table));
table->column_spacing = spacing;
- for (col = 0; col < table->ncols - 1; col++)
+ for (col = 0; col + 1 < table->ncols; col++)
table->cols[col].spacing = spacing;
if (GTK_WIDGET_VISIBLE (table))
for (col = 0; col < table->ncols; col++)
requisition->width += table->cols[col].requisition;
- for (col = 0; col < table->ncols - 1; col++)
+ for (col = 0; col + 1 < table->ncols; col++)
requisition->width += table->cols[col].spacing;
for (row = 0; row < table->nrows; row++)
requisition->height += table->rows[row].requisition;
- for (row = 0; row < table->nrows - 1; row++)
+ for (row = 0; row + 1 < table->nrows; row++)
requisition->height += table->rows[row].spacing;
requisition->width += GTK_CONTAINER (table)->border_width * 2;
{
width = real_width;
- for (col = 0; col < table->ncols - 1; col++)
+ for (col = 0; col + 1 < table->ncols; col++)
width -= table->cols[col].spacing;
for (col = 0; col < table->ncols; col++)
if (table->cols[col].shrink)
nshrink += 1;
}
- for (col = 0; col < table->ncols - 1; col++)
+ for (col = 0; col + 1 < table->ncols; col++)
width += table->cols[col].spacing;
/* Check to see if we were allocated more width than we requested.
{
height = real_height;
- for (row = 0; row < table->nrows - 1; row++)
+ for (row = 0; row + 1 < table->nrows; row++)
height -= table->rows[row].spacing;
if (table->rows[row].shrink)
nshrink += 1;
}
- for (row = 0; row < table->nrows - 1; row++)
+ for (row = 0; row + 1 < table->nrows; row++)
height += table->rows[row].spacing;
/* Check to see if we were allocated more height than we requested.
GtkAllocation *allocation);
-guint
+GtkType
gtk_vbox_get_type (void)
{
- static guint vbox_type = 0;
+ static GtkType vbox_type = 0;
if (!vbox_type)
{
(GtkArgGetFunc) NULL,
};
- vbox_type = gtk_type_unique (gtk_box_get_type (), &vbox_info);
+ vbox_type = gtk_type_unique (GTK_TYPE_BOX, &vbox_info);
}
return vbox_type;
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
#ifdef __cplusplus
extern "C" {
+#pragma }
#endif /* __cplusplus */
-#define GTK_VBOX(obj) GTK_CHECK_CAST (obj, gtk_vbox_get_type (), GtkVBox)
-#define GTK_VBOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_vbox_get_type (), GtkVBoxClass)
-#define GTK_IS_VBOX(obj) GTK_CHECK_TYPE (obj, gtk_vbox_get_type ())
+#define GTK_TYPE_VBOX (gtk_vbox_get_type ())
+#define GTK_VBOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_VBOX, GtkVBox))
+#define GTK_VBOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_VBOX, GtkVBoxClass))
+#define GTK_IS_VBOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_VBOX))
+#define GTK_IS_VBOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VBOX))
-typedef struct _GtkVBox GtkVBox;
+typedef struct _GtkVBox GtkVBox;
typedef struct _GtkVBoxClass GtkVBoxClass;
struct _GtkVBox
};
-guint gtk_vbox_get_type (void);
-GtkWidget* gtk_vbox_new (gint homogeneous,
+GtkType gtk_vbox_get_type (void);
+GtkWidget* gtk_vbox_new (gint homogeneous,
gint spacing);
g_return_if_fail (widget->parent == NULL);
g_return_if_fail (!GTK_WIDGET_TOPLEVEL (widget));
g_return_if_fail (parent != NULL);
+ g_return_if_fail (widget != parent);
/* keep this function in sync with gtk_menu_attach_to_widget()
*/
gtk_widget_propagate_state (widget, &data);
- while (parent->parent != NULL)
- parent = parent->parent;
-
gtk_widget_set_style_recurse (widget, NULL);
gtk_signal_emit (GTK_OBJECT (widget), widget_signals[PARENT_SET], NULL);